<template>
  <div>
    <h1>Student组件</h1>
    <h2>sum:{{ sum }}</h2>
    <h2>sum放大10倍 {{ bigSum }}</h2>
    <button @click="add(1)">点我加1</button>
    <button @click="addCommit(1)">点我加1</button>
  </div>
</template>

<script>
import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
export default {
  name: "Student",
  computed: {
    ...mapState("count",["sum"]),
    ...mapGetters("count",["bigSum"]),
  },
  methods: {
    ...mapActions("count",["add"]),
    ...mapMutations("count",{ addCommit: "ADD" }),
  },
  mounted() {
    console.log(this.$store);
  },
};
</script>
